package com.sherlockHolmes.init.base.task;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

public class ArriveMessageTask implements Job {
//    @Autowired
//    ConferReceptionService conferReceptionService;
//    @Autowired
//    MessageService messageService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        String condition =(String)jobExecutionContext.getJobDetail().getJobDataMap().get("condition");
       //以逗号分割字符串
        String[] arr = condition.split(",");
        String[] s1 = arr[2].split(" ");
        String substring = s1[1].substring(0, 5);
        System.out.println(substring);
        String message=arr[0]+"|"+arr[1]+"即将到达，到达时间"+substring;
        String stationId = arr[3];//到达站点
        String activityId=arr[4];
        //根据站点,到达时间 查找对应的接待负责人，可能有几个接待负责人
//        conferReceptionService.selectStartId(activityId,stationId,arr[2]);
//        ConferReception conferReception = new ConferReception();
//        conferReception.setStationId(Integer.valueOf(stationId));
//        List<ConferReception> select = conferReceptionService.select(conferReception);
//        Integer userId, Integer activityId, String content, String type
//        select.forEach(reception -> {
//            messageService.add(reception.getStaffId(),reception.getActivityId(),message,"11");
//        });
    }
}
